﻿using System.Collections.Generic;
using Natural.Actions;
using Natural.Attributes;
using Natural.Managers;
using Natural.Model;
using Natural.Providers;

namespace Natural.Decorators
{
    [Impl(Type = ImplType.Decorator, Name = "Query", Strategy = "Log", Version = 0, Priority = 0)]
    public class QueryLogDecorator : Query
    {
        private Query Decorated;
        public QueryLogDecorator(Query decorated)
        {
            Decorated = decorated;
        }
        public override List<object[]> Execute(ActionContext context, Expression expression)
        {
            Logger.Log("Query", Serializer.Serialize(expression));
            return Decorated.Execute(context,expression);
        }
    }
}
